import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    meta: { keepAlive: true },
    component: Home
  },
  {
    path: '/plan',
    name: 'Plan',
    component: () => import('../views/plan')
  },
  {
    path: '/sale',
    name: 'Sale',
    meta: { keepAlive: true },
    component: () => import('../views/sale/index')
  },
  {
    path: '/sale/detail',
    name: 'SaleDetail',
    component: () => import('../views/sale/detail')
  },
  {
    path: '/plan/today',
    name: 'TodayPlan',
    component: () => import('../views/plan/today')
  },
  {
    path: '/plan/week',
    name: 'PlanWeek',
    component: () => import('../views/plan/week')
  },
  {
    path: '/user',
    name: 'User',
    component: () => import('../views/user')
  },
  {
    path: '/order/img',
    name: 'ImgOrder',
    component: () => import('../views/order/img')
  },
  {
    path: '/order/img/list',
    name: 'ImgOrderList',
    component: () => import('../views/order/img-list')
  },
  {
    path: '/user/info',
    name: 'UserInfo',
    component: () => import('../views/user/info')
  },
  {
    path: '/user/sum',
    name: 'UserSum',
    component: () => import('../views/user/sum')
  },
  {
    path: '/todo',
    name: 'Todo',
    meta: { keepAlive: true },
    component: () => import('../views/todo')
  },
  {
    path: '/todo/add',
    name: 'TodoAdd',
    component: () => import('../views/todo/add')
  },
  {
    path: '/todo/type',
    name: 'TodoType',
    meta: { keepAlive: true },
    component: () => import('../views/todo/type')
  },
  {
    path: '/todo/sum',
    name: 'TodoSum',
    meta: { keepAlive: true },
    component: () => import('../views/todo/sum')
  },
  {
    path: '/todo/record',
    name: 'TodoRecord',
    meta: { keepAlive: true },
    component: () => import('../views/todo/record')
  },
  {
    path: '/todo/visit',
    name: 'Visit',
    component: () => import('../views/todo/visit')
  },
  {
    path: '/todo/hunt',
    name: 'Hunt',
    component: () => import('../views/todo/hunt')
  },
  {
    path: '/todo/other',
    name: 'Other',
    component: () => import('../views/todo/other')
  },
  {
    path: '/todo/act',
    name: 'Act',
    component: () => import('../views/todo/act/index')
  },
  {
    path: '/todo/act/sum',
    name: 'ActSum',
    component: () => import('../views/todo/act/sum')
  },
  {
    path: '/todo/send',
    name: 'Send',
    component: () => import('../views/todo/send')
  },
  {
    path: '/todo/head',
    name: 'Head',
    component: () => import('../views/todo/head')
  },
  {
    path: '/score',
    name: 'Score',
    meta: { keepAlive: true },
    component: () => import('../views/score/index')
  },
  {
    path: '/route/add',
    name: 'RouteAdd',
    component: () => import('@/views/route/add')
  },
  {
    path: '/route/shop',
    name: 'RouteShop',
    component: () => import('@/views/route/shop')
  },
  {
    path: '/route/school',
    name: 'RouteSchool',
    component: () => import('@/views/route/school')
  },
  {
    path: '/route/index',
    name: 'RouteIndex',
    component: () => import('@/views/route/index')
  },
  {
    path: '/shop/edit',
    name: 'ShopEdit',
    component: () => import('@/views/shop/edit')
  },
  {
    path: '/school/edit',
    name: 'SchoolEdit',
    component: () => import('@/views/school/edit')
  },
  {
    path: '/code',
    name: 'Code',
    meta: { keepAlive: true },
    component: () => import('../views/code/index')
  },
  {
    path: '/share',
    name: 'Share',
    meta: { keepAlive: true },
    component: () => import('../views/share/index')
  },
  {
    path: '/score/visit',
    name: 'ScoreVisit',
    component: () => import('../views/score/visit')
  },
  {
    path: '/score/hunt',
    name: 'ScoreHunt',
    component: () => import('../views/score/hunt')
  },
  {
    path: '/score/other',
    name: 'ScoreHunt',
    component: () => import('../views/score/other')
  },
  {
    path: '/score/send',
    name: 'ScoreSend',
    component: () => import('../views/score/send')
  },
  {
    path: '/score/act',
    name: 'ScoreAct',
    component: () => import('../views/score/act')
  },
  {
    path: '/score/head',
    name: 'ScoreHead',
    component: () => import('../views/score/head')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/register')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/ban',
    name: 'Ban',
    component: () => import('../views/ban')
  },
  {
    path: '/apply/goods',
    name: 'ApplyGoods',
    component: () => import('../views/apply/goods/index'),
    children: [
      {
        path: '/apply/goods/list',
        name: 'ApplyGoodsList',
        component: () => import('../views/apply/goods/list')
      },
      {
        path: '/apply/goods/apply',
        name: 'ApplyGoods',
        component: () => import('../views/apply/goods/apply')
      }
    ]
  },
  {
    path: '/apply/cost',
    name: 'ApplyCost',
    redirect: '/apply/cost/apply',
    component: () => import('../views/apply/cost/index'),
    children: [
      {
        path: '/apply/cost/list',
        name: 'ApplyCostList',
        component: () => import('../views/apply/cost/list')
      },
      {
        path: '/apply/cost/apply',
        name: 'ApplyCost',
        component: () => import('../views/apply/cost/apply')
      }
    ]
  },
  {
    path: '/apply/advise',
    name: 'ApplyAdvise',
    component: () => import('../views/apply/advise/index'),
    children: [
      {
        path: '/apply/advise/list',
        name: 'ApplyAdviseList',
        component: () => import('../views/apply/advise/list')
      },
      {
        path: '/apply/advise/apply',
        name: 'ApplyAdivse',
        component: () => import('../views/apply/advise/apply')
      }
    ]
  },
  {
    path: '/apply/bus',
    name: 'ApplyBus',
    component: () => import('../views/apply/bus/index'),
    children: [
      {
        path: '/apply/bus/apply',
        component: () => import('../views/apply/bus/apply')
      },
      {
        path: '/apply/bus/apply/leave',
        component: () => import('../views/apply/bus/apply_leave')
      },
      {
        path: '/apply/bus/list',
        component: () => import('../views/apply/bus/list')
      },
      {
        path: '/apply/bus/list/leave',
        component: () => import('../views/apply/bus/list_leave')
      },
      {
        path: '/apply/bus/check',
        name: 'Check',
        component: () => import('../views/apply/bus/list')
      }
    ]
  }
  // {
  //   path: '/apply/bus/apply',
  //   name: 'ApplyBusApply',
  //   component: () => import('../views/apply/bus/apply')
  // },
  // {
  //   path: '/apply/bus/list',
  //   name: 'ApplyBusList',
  //   component: () => import('../views/apply/bus/list')
  // }
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
